﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!--
        Esta animação só está aqui porque o Blend não aceita DynamicResource com Storyboard
    -->
    
    <!--BEGIN TEXTBOX-->
    <Storyboard x:Key="AnimationTextBoxWatermarkEnter" TargetName="Watermark" TargetProperty="Opacity">
        <DoubleAnimation Duration="0:0:0.3" To="0.4"/>
    </Storyboard>

    <Storyboard x:Key="AnimationTextBoxWatermarkLeave" TargetName="Watermark" TargetProperty="Opacity">
        <DoubleAnimation Duration="0:0:0.4"/>
    </Storyboard>

    <Storyboard x:Key="AnimationTextBoxWatermarkTextEnter" TargetName="Watermark" TargetProperty="Opacity">
        <DoubleAnimation Duration="0:0:0.3" From="0.4" To="0"/>
    </Storyboard>

    <Storyboard x:Key="AnimationTextBoxWatermarkTextLeave" TargetName="Watermark" TargetProperty="Opacity">
        <DoubleAnimation Duration="0:0:0.4"/>
    </Storyboard>
    <!--END TEXTBOX-->

    <!--BEGIN TEXTBOX-->
    <Style TargetType="{x:Type TextBox}">
        <Setter Property="BorderBrush" Value="{DynamicResource BrushTextBoxBorder}"/>
        <Setter Property="Foreground" Value="{DynamicResource BrushTextBoxForeground}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="HorizontalContentAlignment" Value="Left"/>
        <Setter Property="Padding" Value="0,4,0,0"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="AllowDrop" Value="True"/>
        <Setter Property="FontFamily" Value="Tahoma"/>
        <Setter Property="FontSize" Value="11"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="FontStyle" Value="Normal"/>
        <Setter Property="Height" Value="21"/>
        <Setter Property="Width" Value="100"/>
        <Setter Property="TextWrapping" Value="NoWrap"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBox}">
                    <Border CornerRadius="4" Background="{DynamicResource BrushTextBoxBackground}" BorderBrush="{DynamicResource BrushTextBoxBorder}" BorderThickness="1">
                        <Grid>
                            <Border x:Name="Border" SnapsToDevicePixels="False" CornerRadius="4" Background="{DynamicResource BrushTextBoxBackground}"/>
                            <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RenderTransformOrigin="0.5,0.5" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsReadOnly" Value="True">
                            <Setter Property="BorderBrush" Value="{DynamicResource BrushTextBoxBorderDisabled}" TargetName="Border"/>
                            <Setter Property="Background" Value="{DynamicResource BrushTextBoxBackgroundDisabled}" TargetName="Border"/>
                            <Setter Property="Foreground" Value="{DynamicResource BrushTextBoxForegroundDisabled}"/>
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="BorderBrush" Value="{DynamicResource BrushTextBoxBorderDisabled}" TargetName="Border"/>
                            <Setter Property="Background" Value="{DynamicResource BrushTextBoxBackgroundDisabled}" TargetName="Border"/>
                            <Setter Property="Foreground" Value="{DynamicResource BrushTextBoxForegroundDisabled}"/>
                        </Trigger>
                        <Trigger Property="TextWrapping" Value="Wrap">
                            <Setter Property="Height" Value="50"/>
                            <Setter Property="AcceptsReturn" Value="True"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <!--<Setter Property="Validation.ErrorTemplate">
            <Setter.Value>
                <ControlTemplate>
                    <Grid>
                        <AdornedElementPlaceholder />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>-->
    </Style>
    <!--END TEXTBOX-->
</ResourceDictionary>